Marketplace API (1.0.0)

Download OpenAPI specification:Download

An API for the Marketplace application

product

Products added to the Market Place by sellers

Create a product

Create a product to sell. Using the product name, description, condition, category and price

Request Body schema: application/json

The products information

description
required
string <= 700 characters

A 700 character description of the product

name
required
string

The name of the product

price
required
integer

The price of the product

condition
required
string

A description of the condition of the product

category
required
string

The category the product belongs in

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string"
}

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Query products

Query the catalog of products

query Parameters
query
string

A query to match

limit
integer

The limit of products returned

sortBy
string

The sorting order

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Delete a product

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Sell a product

Will set a products as sold

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Update a product

Update one of the product's properties

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Request Body schema: application/json

Choose at least one of the following properties to update

non-empty
description
string <= 700 characters

A 700 character description of the product

name
string

The name of the product

price
integer

The price of the product

condition
string

A description of the condition of the product

category
string

The category the product belongs in

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string"
}

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Get a product

Get a product's inforamtion with the itemNumber

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Get a product's owner

Get information on a product's owner

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "imageName": "string",
  • "arrayOfProducts": [
    ]
}

Get a product's images

Get all the images for a product

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set product image

Set a product's image(s)

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Request Body schema: multipart/form-data

An image url

file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Delete product image

Delete a product's image(s)

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Request Body schema: application/json

An array of images

Array
string

A images's name

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

offer

Access to offers from buyers

Accept offer

Accept an offer made on an item

path Parameters
offerRef
required
string

An offer for a product

Responses

Reject offer

Reject an offer made on a product

path Parameters
offerRef
required
string

An offer for a product

Responses

Read offer

Read an offer made for a product

path Parameters
offerRef
required
string

An offer for a product

Responses

Response samples

Content type
application/json
{
  • "offerAmount": 0,
  • "productRef": "string",
  • "reference": "string",
  • "offerViewed": true,
  • "offerAccepted": true,
  • "offerRejected": true,
  • "offerDate": "2019-08-24",
  • "message": "string",
  • "buyerReference": "string"
}

Read all offers

Read all the offers for a specific product

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Creat an offer

Create and send an offer to a seller

Request Body schema: application/json

A offer needs only offerAmount, buyerReference, and productRef

offerAmount
number

The dollar amount being offered for the product

productRef
string

The identifier for the product

buyerReference
string

A reference to the user sending the offer

Responses

Request samples

Content type
application/json
{
  • "offerAmount": 0,
  • "productRef": "string",
  • "buyerReference": "string"
}

message

Access to the user messages

Get all messages

Get all the messages

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Send a message

Send a message to a seller

Request Body schema: application/json
senderRef
required
string

The sender's reference (username)

recipientRef
required
string

The recipient reference (username)

text
required
string <= 700 characters

The message body

date
string <date>

The date the message was sent

Responses

Request samples

Content type
application/json
{
  • "senderRef": "string",
  • "recipientRef": "string",
  • "text": "string",
  • "date": "2019-08-24"
}

Response samples

Content type
application/json
{
  • "senderRef": "string",
  • "recipientRef": "string",
  • "text": "string",
  • "date": "2019-08-24"
}

Read a message

Read a message with the provided reference

path Parameters
messageRef
required
string

A message reference

Responses

Response samples

Content type
application/json
{
  • "senderRef": "string",
  • "recipientRef": "string",
  • "text": "string",
  • "date": "2019-08-24"
}

Delete a message

Delete a message

path Parameters
messageRef
required
string

A message reference

Responses

Get all conversations

Get all conversations for a user

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Reply to a message

Send a reply to a message

path Parameters
messageRef
required
string

A message reference

Request Body schema: application/json
senderRef
required
string

The sender's reference (username)

recipientRef
required
string

The recipient reference (username)

text
required
string <= 700 characters

The message body

date
string <date>

The date the message was sent

Responses

Request samples

Content type
application/json
{
  • "senderRef": "string",
  • "recipientRef": "string",
  • "text": "string",
  • "date": "2019-08-24"
}

Response samples

Content type
application/json
{
  • "senderRef": "string",
  • "recipientRef": "string",
  • "text": "string",
  • "date": "2019-08-24"
}

user

Operations on users

Create a user

Register a user account

Request Body schema: application/json
password
required
string <password>
username
required
string
email
required
string

Responses

Request samples

Content type
application/json
{
  • "password": "pa$$word",
  • "username": "string",
  • "email": "string"
}

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Update a user

Update a user's username

Authorizations:
BearerAuth
Request Body schema: application/json
username
string

Responses

Request samples

Content type
application/json
{
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Log a user in

Log a user in using email and password

Request Body schema: application/json
password
string <password>
email
string

Responses

Request samples

Content type
application/json
{
  • "password": "pa$$word",
  • "email": "string"
}

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Log a user out

Log an authenticated user out of current device

Authorizations:
BearerAuth

Responses

Log a user out from all devices

Log an authenticated user out of all devices

Authorizations:
BearerAuth

Responses

Get the public information for a user

Get username, image, and product's from a user

path Parameters
username
required
string <username>

The user's username

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "imageName": "string",
  • "arrayOfProducts": [
    ]
}

Get a product's owner

Get information on a product's owner

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "imageName": "string",
  • "arrayOfProducts": [
    ]
}

Get a product's images

Get all the images for a product

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set user's image

Set a user's image(s)

Authorizations:
BearerAuth
Request Body schema: multipart/form-data

An image url

file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Delete user image

Delete a user's image(s)

Authorizations:
BearerAuth
Request Body schema: application/json

An array of images

Array
string

A images's name

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

image

Operations on images

Get a product's images

Get all the images for a product

path Parameters
itemNumber
required
string

Product's reference

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set user's image

Set a user's image(s)

Authorizations:
BearerAuth
Request Body schema: multipart/form-data

An image url

file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Delete user image

Delete a user's image(s)

Authorizations:
BearerAuth
Request Body schema: application/json

An array of images

Array
string

A images's name

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
{
  • "username": "string",
  • "email": "user@example.com",
  • "imageName": "string",
  • "arrayOfProducts": [
    ],
  • "token": "string"
}

Set product image

Set a product's image(s)

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Request Body schema: multipart/form-data

An image url

file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}

Delete product image

Delete a product's image(s)

Authorizations:
BearerAuth
path Parameters
itemNumber
required
string

Product's reference

Request Body schema: application/json

An array of images

Array
string

A images's name

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
{
  • "owner": "string",
  • "description": "string",
  • "itemNumber": "string",
  • "imagePaths": [
    ],
  • "name": "string",
  • "price": 0,
  • "condition": "string",
  • "category": "string",
  • "sold": true
}